package com.elepant.tank;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

public class ResourceImage {

    public static BufferedImage goodTankU,goodTankD,goodTankR,goodTankL;
    public static BufferedImage badTankU,badTankD,badTankL,badTankR;

    public static BufferedImage bulletU,bulletD,bulletL,bulletR;

    public static BufferedImage[] explodes = new BufferedImage[16];

    static {
        try {
            goodTankU = ImageIO.read(ResourceImage.class.getClassLoader().getResourceAsStream("images/GoodTank1.png"));
            goodTankL = ImageUtil.rotateImage(goodTankU, -90);
            goodTankR = ImageUtil.rotateImage(goodTankU, 90);
            goodTankD = ImageUtil.rotateImage(goodTankU, 180);
            //tankD = ImageIO.read(ResourceImage.class.getClassLoader().getResourceAsStream("images/tankD.gif"));
            //tankL = ImageIO.read(ResourceImage.class.getClassLoader().getResourceAsStream("images/tankL.gif"));
            //tankR = ImageIO.read(ResourceImage.class.getClassLoader().getResourceAsStream("images/tankR.gif"));
             //tankU = ImageIO.read(new File(("D:/Elephant/project/elephantstudy/src/images/tankU.gif")));

            badTankU = ImageIO.read(ResourceImage.class.getClassLoader().getResourceAsStream("images/BadTank1.png"));
            badTankL = ImageUtil.rotateImage(badTankU, -90);
            badTankR = ImageUtil.rotateImage(badTankU, 90);
            badTankD = ImageUtil.rotateImage(badTankU, 180);

            bulletU = ImageIO.read(ResourceImage.class.getClassLoader().getResourceAsStream("images/bulletU.png"));
            bulletL = ImageUtil.rotateImage(bulletU, -90);
            bulletR = ImageUtil.rotateImage(bulletU, 90);
            bulletD = ImageUtil.rotateImage(bulletU, 180);

            for(int i=0;i<16;i++){
                explodes[i] = ImageIO.read(ResourceImage.class.getClassLoader().getResourceAsStream("images/e"+(i+1)+".gif"));
            }


        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
